package com.qianchang.microfinance.view.mine.intention;

import android.os.Bundle;

import com.qianchang.microfinance.R;
import com.qianchang.microfinance.bean.LoanIntentBean;
import com.qianchang.microfinance.bean.PageBean;
import com.qianchang.microfinance.utils.DMConstant;
import com.qianchang.microfinance.view.base.BaseRecyclerAdapter;
import com.qianchang.microfinance.view.base.BaseRecyclerViewActivity;
import com.dm.library.http.DMOKHttpUtils;
import com.dm.library.http.HttpParams;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;

import butterknife.ButterKnife;

/**
 * 借款意向
 */
public class LoanIntentionActivity extends BaseRecyclerViewActivity<LoanIntentBean> {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_loan_intention);
        ButterKnife.bind(this);
        setTitleName(getString(R.string.title_loan_intention));
        initView();
        initData();
    }

    @Override
    protected void initView() {
        super.initView();
    }

    @Override
    protected void requestData(HttpParams params) {
        params.put("opSource", 1);
        params.put("maxResults", 10);
        DMOKHttpUtils.getInstance().post(this, DMConstant.ApiURL.LOAN_INTENT_LIST, params, mCallBack);
    }

    @Override
    protected BaseRecyclerAdapter<LoanIntentBean> getRecyclerAdapter() {
        return new LoanIntentionAdapter(this);
    }

    @Override
    protected Type getType() {
        return new TypeToken<PageBean<LoanIntentBean>>() {
        }.getType();
    }
}